<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <button @click="getList">获取数据</button>
  <p v-for="e in list">书名：{{e.name}},价格：{{e.price}}</p>
</div>
</body>
</html>
<script src="js/vue.min.js"></script>
<script src="js/axios.min.js"></script>
<script>
  new Vue({
    el: '#app',
    data: {
      list: []
    },
    methods: {
      getList() {
        /*
            axios({
                url:'',
                method:'get'
            }).then(resp=>{

            })
         */
        axios({
          url: 'http://localhost:8888/book/fresh_book',
          method: 'get'
        }).then(resp => {
          // 返回的数据 resp.data
          this.list = resp.data.data
        })
      }
    },
    created() {
      this.getList()
    }
  })
</script>